/**
 * <copyright>
 * </copyright>
 *

 */
package hu.bme.mit.androtext.androgui.androGuiDsl.impl;

import hu.bme.mit.androtext.androgui.androGuiDsl.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class AndroGuiDslFactoryImpl extends EFactoryImpl implements AndroGuiDslFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static AndroGuiDslFactory init()
  {
    try
    {
      AndroGuiDslFactory theAndroGuiDslFactory = (AndroGuiDslFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.bme.hu/mit/androtext/androgui/AndroGuiDsl"); 
      if (theAndroGuiDslFactory != null)
      {
        return theAndroGuiDslFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new AndroGuiDslFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroGuiDslFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case AndroGuiDslPackage.ANDRO_GUI_MODEL_ROOT: return createAndroGuiModelRoot();
      case AndroGuiDslPackage.UI_ELEMENT: return createUIElement();
      case AndroGuiDslPackage.LAYOUT: return createLayout();
      case AndroGuiDslPackage.ROOT_LAYOUT: return createRootLayout();
      case AndroGuiDslPackage.BASE_LAYOUT: return createBaseLayout();
      case AndroGuiDslPackage.ABSOLUTE_LAYOUT: return createAbsoluteLayout();
      case AndroGuiDslPackage.LINEAR_LAYOUT: return createLinearLayout();
      case AndroGuiDslPackage.FRAME_LAYOUT: return createFrameLayout();
      case AndroGuiDslPackage.RELATIVE_LAYOUT: return createRelativeLayout();
      case AndroGuiDslPackage.WIDGET: return createWidget();
      case AndroGuiDslPackage.TEXT_VIEW: return createTextView();
      case AndroGuiDslPackage.EDIT_TEXT: return createEditText();
      case AndroGuiDslPackage.BUTTON: return createButton();
      case AndroGuiDslPackage.LIST_VIEW: return createListView();
      case AndroGuiDslPackage.SPINNER: return createSpinner();
      case AndroGuiDslPackage.CHECK_BOX: return createCheckBox();
      case AndroGuiDslPackage.RADIO_GROUP: return createRadioGroup();
      case AndroGuiDslPackage.RATING_BAR: return createRatingBar();
      case AndroGuiDslPackage.TOGGLE_BUTTON: return createToggleButton();
      case AndroGuiDslPackage.RADIO_BUTTON: return createRadioButton();
      case AndroGuiDslPackage.PREFERENCE_SCREEN: return createPreferenceScreen();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object createFromString(EDataType eDataType, String initialValue)
  {
    switch (eDataType.getClassifierID())
    {
      case AndroGuiDslPackage.LAYOUT_STYLE:
        return createLayoutStyleFromString(eDataType, initialValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String convertToString(EDataType eDataType, Object instanceValue)
  {
    switch (eDataType.getClassifierID())
    {
      case AndroGuiDslPackage.LAYOUT_STYLE:
        return convertLayoutStyleToString(eDataType, instanceValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroGuiModelRoot createAndroGuiModelRoot()
  {
    AndroGuiModelRootImpl androGuiModelRoot = new AndroGuiModelRootImpl();
    return androGuiModelRoot;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public UIElement createUIElement()
  {
    UIElementImpl uiElement = new UIElementImpl();
    return uiElement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Layout createLayout()
  {
    LayoutImpl layout = new LayoutImpl();
    return layout;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RootLayout createRootLayout()
  {
    RootLayoutImpl rootLayout = new RootLayoutImpl();
    return rootLayout;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BaseLayout createBaseLayout()
  {
    BaseLayoutImpl baseLayout = new BaseLayoutImpl();
    return baseLayout;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AbsoluteLayout createAbsoluteLayout()
  {
    AbsoluteLayoutImpl absoluteLayout = new AbsoluteLayoutImpl();
    return absoluteLayout;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LinearLayout createLinearLayout()
  {
    LinearLayoutImpl linearLayout = new LinearLayoutImpl();
    return linearLayout;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public FrameLayout createFrameLayout()
  {
    FrameLayoutImpl frameLayout = new FrameLayoutImpl();
    return frameLayout;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RelativeLayout createRelativeLayout()
  {
    RelativeLayoutImpl relativeLayout = new RelativeLayoutImpl();
    return relativeLayout;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Widget createWidget()
  {
    WidgetImpl widget = new WidgetImpl();
    return widget;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TextView createTextView()
  {
    TextViewImpl textView = new TextViewImpl();
    return textView;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EditText createEditText()
  {
    EditTextImpl editText = new EditTextImpl();
    return editText;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Button createButton()
  {
    ButtonImpl button = new ButtonImpl();
    return button;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ListView createListView()
  {
    ListViewImpl listView = new ListViewImpl();
    return listView;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Spinner createSpinner()
  {
    SpinnerImpl spinner = new SpinnerImpl();
    return spinner;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public CheckBox createCheckBox()
  {
    CheckBoxImpl checkBox = new CheckBoxImpl();
    return checkBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RadioGroup createRadioGroup()
  {
    RadioGroupImpl radioGroup = new RadioGroupImpl();
    return radioGroup;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RatingBar createRatingBar()
  {
    RatingBarImpl ratingBar = new RatingBarImpl();
    return ratingBar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ToggleButton createToggleButton()
  {
    ToggleButtonImpl toggleButton = new ToggleButtonImpl();
    return toggleButton;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RadioButton createRadioButton()
  {
    RadioButtonImpl radioButton = new RadioButtonImpl();
    return radioButton;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public PreferenceScreen createPreferenceScreen()
  {
    PreferenceScreenImpl preferenceScreen = new PreferenceScreenImpl();
    return preferenceScreen;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LayoutStyle createLayoutStyleFromString(EDataType eDataType, String initialValue)
  {
    LayoutStyle result = LayoutStyle.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertLayoutStyleToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AndroGuiDslPackage getAndroGuiDslPackage()
  {
    return (AndroGuiDslPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static AndroGuiDslPackage getPackage()
  {
    return AndroGuiDslPackage.eINSTANCE;
  }

} //AndroGuiDslFactoryImpl
